package com.wx.bootsecurity.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wx.bootsecurity.entity.WxUserRoleRelation;
import com.wx.bootsecurity.mapper.WxUserRoleRelationMapper;
import com.wx.bootsecurity.service.WxUserRoleRelationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 后台用户和角色关系表 服务实现类
 * </p>
 *
 * @author 阿尔法哲
 * @since 2021-07-22
 */
@Service
public class WxUserRoleRelationServiceImpl extends ServiceImpl<WxUserRoleRelationMapper, WxUserRoleRelation> implements WxUserRoleRelationService {

    @Autowired
    private WxUserRoleRelationMapper wxUserRoleRelationMapper;

    @Override
    public List<WxUserRoleRelation> findByAdminId(Long id) {
        QueryWrapper<WxUserRoleRelation> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("admin_id",id);
        List<WxUserRoleRelation> wxUserRoleRelationList = wxUserRoleRelationMapper.selectList(queryWrapper);
        return wxUserRoleRelationList;
    }

}
